/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// Categories object for NHibernate mapped table 'categories'.
	/// </summary>
	[Serializable]
	public class Categories
	{
		#region Member Variables
		protected int _categoryid;
		protected string _categoryname;
		protected IList<Product> _product;
		#endregion
		#region Constructors
			
		public Categories() {}
					
		public Categories(string categoryname) 
		{
			this._categoryname= categoryname;
		}

		#endregion
		#region Public Properties
		public int CategoryId
		{
			get { return _categoryid; }
			set {_categoryid= value; }
		}
		public string CategoryName
		{
			get { return _categoryname; }
			set {_categoryname= value; }
		}
		public IList<Product> Product
		{
			get { return _product; }
			set {_product= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Categories castObj = (Categories)obj;
			return ( castObj != null ) &&
			this._categoryid == castObj.CategoryId;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _categoryid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
